﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    public class PageModel<T> where T:class
    {
        /// <summary>
        ///总页数
        /// </summary>
        public int TotalPage
        {
            get
            {
                return Total % PageSize == 0 ? Total / PageSize : Total / PageSize + 1;
            }
        }

        /// <summary>
        /// 每页条数
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 当前第几页
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 总条数
        /// </summary>
        public int Total { get; set; }

        /// <summary>
        /// 对应分页数据
        /// </summary>
        public List<T> ObjectList { get; set; }
    }
}
